<template>
  <div class="service">
    <ul class="service_ul">

      <li class="service_li">
        <div class="service_li_left">
          <div class="service_con left_item"><span class="left_item_title">需求内容：</span>
            {{detail.u_name}}申请于{{detail.create_at}}申请【{{detail.catpid_name}}】项目中的【{{detail.cat_name}}】服务
          </div>
          <div class="service_status left_item"><span class="left_item_title">服务状态：</span>
                        <span v-if="detail.status ==1">待解决</span>
                        <span v-else-if="detail.status ==2">正在解决</span>
                        <span v-else-if="detail.status ==3">已解决</span>
                        <span v-else style="color: red">未解决</span>
          </div>
          <div class="service_volunteer left_item"><span class="left_item_title">志愿者：</span><span>{{detail.provider_name}}</span>
          </div>
        </div>

      </li>

    </ul>
    <div class="service_con">
      需求说明：<span v-html="detail.content"></span>
      <hr style="margin-top: 10px;margin-bottom: 10px">
      服务凭证：<span v-html="detail.revcon"></span>
      <div v-for="(item,index) in detail.attach" :key="index">
        <img :src="item" alt="" style="width: 50%;margin-top: 5px;">
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "service_detail",
    data() {
      return {
        id: '',
        detail:''
      }
    },

    created() {
      this.id = this.$route.query.id;

      this.getDetail();
    },

    methods: {
      getDetail(){
        let that =this;
        that.$http.get('/api/WxProgramApi/getVoluntDetail', {id:that.id}, r => {
          console.log('neirong',r)
          that.detail = r.data;
        })
      }
    }
  }
</script>

<style scoped>
  .service {
    /*padding: 59px 37px 0 270px;*/
  }

  .service_con {
    font-size: 24px;
    line-height: 2;
  }

  .service_li {
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #dedede;
    overflow: hidden;
  }

  .left_item {
    padding-bottom: 20px;
    font-size: 24px;
    color: #555555;
  }

  .left_item .left_item_title {
    color: #8b8c8b;
  }

  .service_status {
    color: #02c070;
  }

  .service_li_left {
    float: left;
  }

  .service_li_right img {
    width: 100%;
  }
</style>
